<?php

namespace EShop\Controller;

/**
 * AppbaseMyController 类
 *
 * @since VER:1.0; DATE:2016-9-1; AUTHOR:SoChishun; EMAIL:14507247@qq.com; DESC:Added.
 */
class AppbaseMyController extends \Common\Controller\CommonController {

    /**
     * 空操作，用于输出404页面
     * @since 1.0 <2015-3-23> SoChishun Added.
     */
    public function _empty() {
        $this->display('XPage/404');
    }

    public function _initialize() {
        $login_url = U('EShop/Passport/login');

        // 站点是否关闭检测
        // 'Y' == $site_conf['site_status'] || exit($site_conf['site_closed_announcement']);
        // 用户登录检测
        if (!user_check_login($this->user_login_data)) {
            if (!I('notredirect')) {
                redirect($login_url);
            }
            exit;
        }
        $pagesize = empty($this->user_login_data['page_size']) ? $site_conf['content_list_rows'] : $this->user_login_data['page_size'];
        C('LIST_ROWS', $pagesize ? $pagesize : 25 ); // 设置全局分页尺寸变量 2016-5-6
        $this->assign('login_data', $this->user_login_data); // 用户登录资料
    }

}
